﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Practices.Unity;

namespace Skynet.WebSite.Account
{
    public partial class Login : Infrastructure.Web.Views.Page,  Skynet.WebFoundation.Views.Login.ILoginView
    {

        private Skynet.WebFoundation.Views.Login.LoginPresenter _Presenter;
        [Dependency]
        public Skynet.WebFoundation.Views.Login.LoginPresenter Presenter
        {
            get { return _Presenter; }
            set
            {
                _Presenter = value;
                this._Presenter.View = this;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        }



        protected void LoginUser_LoggedIn(object sender, EventArgs e)
        {
            this.Presenter.LoginSuccess(this.LoginUser.UserName);
        }
    }
}
